import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      //添加门店信息
      path: '/AddShop',
      name: 'AddShop',
      component: () => import('../views/Shop/AddShop.vue'),
    },
    {
      //显示门店信息
      path: '/ShowShop',
      name: 'ShowShop',
      component: () => import('../views/Shop/ShowShop.vue'),
    },
    {
      //修改门店信息页面
      path: '/UpdShop/:Sid',
      name: 'UpdShop',
      component: () => import('../views/Shop/UpdShop.vue'),
    },
    {
      //添加公告
      path: '/AddInfo',
      name: 'AddInfo',
      component: () => import('../views/Info/AddInfo.vue'),
    },
    {
      //显示公告
      path: '/ShowInfo',
      name: 'ShowInfo',
      component: () => import('../views/Info/ShowInfo.vue'),
    },
    {
      //添加公告类型
      path: '/AddInfotype',
      name: 'AddInfotype',
      component: () => import('../views/Info/AddInfotype.vue'),
    },
  ],
})

export default router
